package i5.atlas.xmpp.filetransfer;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.jivesoftware.smack.XMPPException;

 

/**
*
* @author ekakoll
*/
public class UserDejan extends User {

 

    public void init() throws Exception {
        setUserName("dejan");
        setPassword("dejan");
        ssc = new SimpleSmackClient();
        ssc.login(this.getUserName(), this.getPassword());
    }

 

    public void sendMessage(String message, String destination) throws XMPPException {
        ssc.sendMessage(message, destination);
    }

 

    public void logout() {
        ssc.logout();
    }

 

    public void fileTransfer(String fileName, String destination) throws XMPPException {
        ssc.fileTransfer(fileName, destination);
    }

 

    public void fileReceiver(final boolean accept, final String fileName) {
        ssc.fileReceiver(accept, fileName);
    }

 

    public static void main(String[] args) throws Exception {
        UserDejan ude = new UserDejan();
        ude.init();

 

//        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//        String message = null;
//        while (!(message = br.readLine()).equalsIgnoreCase("bye")) {
            ssc.sendMessage("Dejan sends a message.", "kovachev@gentileschi.informatik.rwth-aachen.de");
//        }

        // Send file to user akolly

        ude.fileTransfer("C:\\Dev\\xmpp.txt","kovachev@gentileschi.informatik.rwth-aachen.de");

 
        ude.logout();
    }
}